<template>
	<view class="container" >
		<u-navbar title="个人中心" :autoBack="true">
		</u-navbar>
		<web-view ref="webview" :update-title="false" :src="src" @message="getMessage"></web-view>
	</view>
</template>

<script>
	import cellGroup from "../../uni_modules/uview-ui/libs/config/props/cellGroup";
	import {
		getUserInfo,
		userLogin,
		setIapCertificate
	} from "@/api/user.js"
	export default {
		data() {
			return {
				src: `https://www.ruyimh.com/`, //正式域名
				// src: `http://192.168.31.144:8080/`, //正式域名

				loading: false,
				statusBarHeight: 0,
				title: 'createRewardedVideoAd'
			}
		},
		onLoad() {

		},
		onReady() {

		},
		methods: {
			getMessage(e) {
				console.log("onload");
				let {
					token,
					userId
				} = e.detail.data[0];
				console.log(token, userId,"用户资料");
				uni.$u.route({
					type: 'to',
					url: "/pages/uniAD/index",
					params: {
						userId: userId,
					}
				})
				uni.setStorageSync('token', token);
				console.log(uni.getStorageSync('token'));
			},
		}
	}
</script>

<style>
	.container {
		padding-top: var(--status-bar-height);
	}
</style>